//
//  DDInvoiceDetailView.swift
//  DingDongZP
//
//  Created by 三秒文化 on 2016/10/17.
//  Copyright © 2016年 51ledian.com. All rights reserved.
//

import UIKit


enum DDInvoiceDetailViewType:String {
    
    case Edit = "Edit"
    case Show = "Show"
    case Line = "Line"
    case Add  = "Add"
    
}

class DDInvoiceDetailViewCell: LDBaseCells{
    
    
    var titleLabArr = ["开票抬头","联  系  人","联系方式","所在地区","详细地址"]
    var descLabArr = ["开票抬头","联系人","联系方式","所在地区","详细地址"] {
        
        didSet{
           
            detailsView!.descTitleArr = descLabArr
        }
    }
    
    private var gampMargin: CGFloat = 0
    var status = false {
        
        didSet{
            
            detailsBar!.selStatusLab!.hidden = !status
        }
    }
    
    lazy var gampView = { return UIView() }()

    var detailsBar:DDInvoiceDetailHeadTitle?
    private var detailsView:LDBaseListTextField?

    
    init(topMargin:CGFloat?,style: UITableViewCellStyle, reuseIdentifier: String?) {
        
        self.gampMargin = topMargin ?? 0
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        initUI()
    }
    
    func initUI() {
        
        backgroundColor = LDGolbalColor.BgGoundGray
        gampView.backgroundColor = LDGolbalColor.White
        detailsBar = DDInvoiceDetailHeadTitle()
        detailsView = LDBaseListTextField.init(listTitleArr: titleLabArr, type: .Show)
        detailsView?.isCanEdit = false
        
        
        gampView.addSubview(detailsBar!)
        gampView.addSubview(detailsView!)
        addSubview(gampView)
        
        gampView.snp_makeConstraints { (make) in
            
            make.top.equalTo(gampMargin)
            make.left.right.equalTo(0)
            make.bottom.equalTo(0)
        }
        
        detailsBar!.snp_makeConstraints { (make) in
            
            make.top.equalTo(LDMargin_V)
            make.right.left.equalTo(0)
            make.height.equalTo(45)
        }
        
        detailsView!.snp_makeConstraints { (make) in
            
            make.top.equalTo(detailsBar!.snp_bottom).offset(LDMargin_V)
            make.left.right.equalTo(detailsBar!)
            make.bottom.equalTo(0)
        }
    }
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
